/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package Interfaz;

import Controladores.ControladorCompeticion;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;
import javax.swing.JOptionPane;
import javax.swing.table.DefaultTableModel;


/**
 *
 * @author jose, Abdelilah,Souhaila
 */
public class InterfazPartido extends javax.swing.JPanel {

    public static InterfazPartido Instancia = null;
    private Boolean es_gestor;   
    
    public static InterfazPartido getInstancia() {
        if (Instancia==null){
            Instancia = new InterfazPartido();
        }
        return Instancia;
    }
    
    /**
     * Creates new form InterfazPartido
     */
    public InterfazPartido() {
        initComponents();
    }

    public String[] cargarDatosFormulario() {
        String [] Datos = new String[4];
        Datos[0] = this.jTextField_Local.getText();
        Datos[1] = this.jTextField_Visitante.getText();
        Datos[2] = this.jTextField_Resul.getText();
        //Datos[3] = this.jTextField_Fecha.getText();
        SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
        Datos[3] = JCalendarFechaParitdo.getDate() != null ? sdf.format(JCalendarFechaParitdo.getDate()):null; 

        return Datos;
    }
    
    public String[] cargarDatosFormularioActa() {
        String [] Datos = new String[15];
        Datos[0] = this.jTextField_TLibres.getText();
        Datos[1] = this.jTextField_TLibresF.getText();            
        Datos[2] = this.jTextField_Tdos.getText();
        Datos[3] = this.jTextField_TdosF.getText();
        Datos[4] = this.jTextField_Ttres.getText();
        Datos[5] = this.jTextField_TtresF.getText();       
        Datos[6] = this.jTextField_PersonalR.getText();
        Datos[7] = this.jTextField_PersonalC.getText();       
        Datos[8] = this.jTextField_TaponesR.getText();
        Datos[9] = this.jTextField_TaponesC.getText();
        Datos[10] = this.jTextField_Rebotes.getText();
        Datos[11] = this.jTextField_Perdidas.getText();
        Datos[12] = this.jTextField_Robos.getText();
        Datos[13] = this.jTextField_Asistencias.getText();
        Datos[14] = this.jTextField_valoracion.getText();
        
        

        return Datos;
    }
    
    /**
     * This method is called from within the constructor to initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is always
     * regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        jPanelPartido1 = new javax.swing.JPanel();
        jLabel_Partido = new javax.swing.JLabel();
        jTextField_Local = new javax.swing.JTextField();
        jTextField_Visitante = new javax.swing.JTextField();
        jLabel_Fecha = new javax.swing.JLabel();
        jLabel_Resultado = new javax.swing.JLabel();
        jTextField_Resul = new javax.swing.JTextField();
        jLabel_sep = new javax.swing.JLabel();
        jButton_Crear = new javax.swing.JButton();
        Boton_ConsultarEquipo = new javax.swing.JButton();
        jButton_Consultar = new javax.swing.JButton();
        jButton_Eliminar = new javax.swing.JButton();
        jLabel_Local = new javax.swing.JLabel();
        jLabel_Visitante = new javax.swing.JLabel();
        jButton_Modificar = new javax.swing.JButton();
        Boton_addActa = new javax.swing.JButton();
        Boton_Limpiar = new javax.swing.JButton();
        jButton_consultarActa = new javax.swing.JButton();
        jScrollPane1 = new javax.swing.JScrollPane();
        Table_Partidos = new javax.swing.JTable();
        JCalendarFechaParitdo = new com.toedter.calendar.JDateChooser();
        jPanelActa = new javax.swing.JPanel();
        jLabel2 = new javax.swing.JLabel();
        jTextField_TLibres = new javax.swing.JTextField();
        jLabel3 = new javax.swing.JLabel();
        jTextField_Tdos = new javax.swing.JTextField();
        jLabel4 = new javax.swing.JLabel();
        jTextField_Ttres = new javax.swing.JTextField();
        jLabel7 = new javax.swing.JLabel();
        jTextField_PersonalR = new javax.swing.JTextField();
        jLabel5 = new javax.swing.JLabel();
        jTextField_TaponesR = new javax.swing.JTextField();
        jLabel_asistencias = new javax.swing.JLabel();
        jTextField_TLibresF = new javax.swing.JTextField();
        jLabel_fallosACanasta = new javax.swing.JLabel();
        jTextField_TdosF = new javax.swing.JTextField();
        jLabel_BalPerdidos = new javax.swing.JLabel();
        jTextField_TtresF = new javax.swing.JTextField();
        jLabel_BalRecuperados = new javax.swing.JLabel();
        jTextField_PersonalC = new javax.swing.JTextField();
        jLabel_taponesHechos = new javax.swing.JLabel();
        jTextField_TaponesC = new javax.swing.JTextField();
        Boton_guardar = new javax.swing.JButton();
        Boton_modActa = new javax.swing.JButton();
        jTextField_Rebotes = new javax.swing.JTextField();
        jLabel9 = new javax.swing.JLabel();
        jLabel10 = new javax.swing.JLabel();
        jTextField_Perdidas = new javax.swing.JTextField();
        jLabel11 = new javax.swing.JLabel();
        jTextField_Asistencias = new javax.swing.JTextField();
        jLabel12 = new javax.swing.JLabel();
        jTextField_Robos = new javax.swing.JTextField();
        jLabel13 = new javax.swing.JLabel();
        jTextField_valoracion = new javax.swing.JTextField();
        jScrollPane2 = new javax.swing.JScrollPane();
        jTable_jugadoresLocal = new javax.swing.JTable();
        jLabel1 = new javax.swing.JLabel();
        jScrollPane3 = new javax.swing.JScrollPane();
        jTable_jugadoresVisit = new javax.swing.JTable();
        jLabel6 = new javax.swing.JLabel();

        jPanelPartido1.setPreferredSize(new java.awt.Dimension(686, 320));

        jLabel_Partido.setText("Equipo");

        jTextField_Local.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jTextField_LocalActionPerformed(evt);
            }
        });

        jTextField_Visitante.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jTextField_VisitanteActionPerformed(evt);
            }
        });

        jLabel_Fecha.setText("Fecha");

        jLabel_Resultado.setText("Resultado");

        jLabel_sep.setText("-");

        jButton_Crear.setText("Crear");
        jButton_Crear.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton_CrearActionPerformed(evt);
            }
        });

        Boton_ConsultarEquipo.setText("Consultar Equipo");
        Boton_ConsultarEquipo.setPreferredSize(new java.awt.Dimension(59, 23));
        Boton_ConsultarEquipo.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                Boton_ConsultarEquipoActionPerformed(evt);
            }
        });

        jButton_Consultar.setText("Consultar");
        jButton_Consultar.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton_ConsultarActionPerformed(evt);
            }
        });

        jButton_Eliminar.setText("Eliminar");
        jButton_Eliminar.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton_EliminarActionPerformed(evt);
            }
        });

        jLabel_Local.setText("Local");

        jLabel_Visitante.setText("Visitante");

        jButton_Modificar.setText("Modificar");
        jButton_Modificar.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton_ModificarActionPerformed(evt);
            }
        });

        Boton_addActa.setText("Crear Acta");
        Boton_addActa.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                Boton_addActaActionPerformed(evt);
            }
        });

        Boton_Limpiar.setText("Limpiar");
        Boton_Limpiar.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                Boton_LimpiarActionPerformed(evt);
            }
        });

        jButton_consultarActa.setText("Consultar Acta");
        jButton_consultarActa.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton_consultarActaActionPerformed(evt);
            }
        });

        Table_Partidos.setModel(new javax.swing.table.DefaultTableModel(
            new Object [][] {

            },
            new String [] {
                "Local", "Visitante", "Resultado", "Fecha"
            }
        ));
        Table_Partidos.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                Table_PartidosMouseClicked(evt);
            }
        });
        jScrollPane1.setViewportView(Table_Partidos);

        JCalendarFechaParitdo.setDateFormatString("dd-MM-yyyy");

        javax.swing.GroupLayout jPanelPartido1Layout = new javax.swing.GroupLayout(jPanelPartido1);
        jPanelPartido1.setLayout(jPanelPartido1Layout);
        jPanelPartido1Layout.setHorizontalGroup(
            jPanelPartido1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanelPartido1Layout.createSequentialGroup()
                .addGap(36, 36, 36)
                .addGroup(jPanelPartido1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanelPartido1Layout.createSequentialGroup()
                        .addComponent(jButton_Crear, javax.swing.GroupLayout.PREFERRED_SIZE, 80, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jButton_Consultar)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addGroup(jPanelPartido1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addGroup(jPanelPartido1Layout.createSequentialGroup()
                                .addComponent(jButton_Modificar, javax.swing.GroupLayout.PREFERRED_SIZE, 86, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                                .addComponent(jButton_Eliminar))
                            .addGroup(jPanelPartido1Layout.createSequentialGroup()
                                .addGap(239, 239, 239)
                                .addComponent(Boton_Limpiar, javax.swing.GroupLayout.PREFERRED_SIZE, 90, javax.swing.GroupLayout.PREFERRED_SIZE)))
                        .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                    .addGroup(jPanelPartido1Layout.createSequentialGroup()
                        .addGroup(jPanelPartido1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(jLabel_Partido)
                            .addGroup(jPanelPartido1Layout.createSequentialGroup()
                                .addGroup(jPanelPartido1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                    .addComponent(jLabel_Fecha)
                                    .addComponent(jLabel_Resultado))
                                .addGap(42, 42, 42)
                                .addGroup(jPanelPartido1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                    .addGroup(jPanelPartido1Layout.createSequentialGroup()
                                        .addGroup(jPanelPartido1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                            .addGroup(jPanelPartido1Layout.createSequentialGroup()
                                                .addComponent(jTextField_Local, javax.swing.GroupLayout.PREFERRED_SIZE, 95, javax.swing.GroupLayout.PREFERRED_SIZE)
                                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                                .addComponent(jLabel_sep))
                                            .addGroup(jPanelPartido1Layout.createSequentialGroup()
                                                .addGap(31, 31, 31)
                                                .addComponent(jLabel_Local)))
                                        .addGroup(jPanelPartido1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                            .addGroup(jPanelPartido1Layout.createSequentialGroup()
                                                .addGap(6, 6, 6)
                                                .addComponent(jTextField_Visitante, javax.swing.GroupLayout.PREFERRED_SIZE, 94, javax.swing.GroupLayout.PREFERRED_SIZE))
                                            .addGroup(jPanelPartido1Layout.createSequentialGroup()
                                                .addGap(30, 30, 30)
                                                .addComponent(jLabel_Visitante))))
                                    .addComponent(jTextField_Resul, javax.swing.GroupLayout.PREFERRED_SIZE, 95, javax.swing.GroupLayout.PREFERRED_SIZE)
                                    .addComponent(JCalendarFechaParitdo, javax.swing.GroupLayout.PREFERRED_SIZE, 133, javax.swing.GroupLayout.PREFERRED_SIZE)))
                            .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 415, javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 74, Short.MAX_VALUE)
                        .addGroup(jPanelPartido1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(jButton_consultarActa)
                            .addGroup(jPanelPartido1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                                .addComponent(Boton_ConsultarEquipo, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                                .addComponent(Boton_addActa, javax.swing.GroupLayout.PREFERRED_SIZE, 155, javax.swing.GroupLayout.PREFERRED_SIZE)))
                        .addGap(43, 43, 43))))
        );

        jPanelPartido1Layout.linkSize(javax.swing.SwingConstants.HORIZONTAL, new java.awt.Component[] {Boton_Limpiar, jButton_Consultar, jButton_Crear, jButton_Eliminar, jButton_Modificar});

        jPanelPartido1Layout.linkSize(javax.swing.SwingConstants.HORIZONTAL, new java.awt.Component[] {jTextField_Local, jTextField_Visitante});

        jPanelPartido1Layout.linkSize(javax.swing.SwingConstants.HORIZONTAL, new java.awt.Component[] {Boton_addActa, jButton_consultarActa});

        jPanelPartido1Layout.setVerticalGroup(
            jPanelPartido1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanelPartido1Layout.createSequentialGroup()
                .addGap(44, 44, 44)
                .addGroup(jPanelPartido1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel_Local)
                    .addComponent(jLabel_Visitante))
                .addGap(5, 5, 5)
                .addGroup(jPanelPartido1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanelPartido1Layout.createSequentialGroup()
                        .addGroup(jPanelPartido1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(jLabel_Partido)
                            .addComponent(jTextField_Local, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(jLabel_sep)
                            .addComponent(jTextField_Visitante, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addGroup(jPanelPartido1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(jLabel_Resultado)
                            .addComponent(jTextField_Resul, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addGap(18, 18, 18)
                        .addGroup(jPanelPartido1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addGroup(jPanelPartido1Layout.createSequentialGroup()
                                .addComponent(jLabel_Fecha)
                                .addGap(24, 24, 24)
                                .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 125, javax.swing.GroupLayout.PREFERRED_SIZE))
                            .addComponent(JCalendarFechaParitdo, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)))
                    .addGroup(jPanelPartido1Layout.createSequentialGroup()
                        .addComponent(Boton_addActa, javax.swing.GroupLayout.PREFERRED_SIZE, 42, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jButton_consultarActa)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(Boton_ConsultarEquipo, javax.swing.GroupLayout.PREFERRED_SIZE, 46, javax.swing.GroupLayout.PREFERRED_SIZE)))
                .addGap(18, 18, 18)
                .addGroup(jPanelPartido1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanelPartido1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                        .addComponent(jButton_Crear, javax.swing.GroupLayout.PREFERRED_SIZE, 34, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addComponent(jButton_Consultar))
                    .addComponent(Boton_Limpiar, javax.swing.GroupLayout.PREFERRED_SIZE, 34, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jButton_Modificar, javax.swing.GroupLayout.PREFERRED_SIZE, 34, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jButton_Eliminar))
                .addContainerGap(22, Short.MAX_VALUE))
        );

        jPanelPartido1Layout.linkSize(javax.swing.SwingConstants.VERTICAL, new java.awt.Component[] {Boton_Limpiar, jButton_Consultar, jButton_Crear, jButton_Eliminar, jButton_Modificar});

        jPanelPartido1Layout.linkSize(javax.swing.SwingConstants.VERTICAL, new java.awt.Component[] {jTextField_Local, jTextField_Visitante});

        jPanelPartido1Layout.linkSize(javax.swing.SwingConstants.VERTICAL, new java.awt.Component[] {Boton_addActa, jButton_consultarActa});

        jLabel2.setText("Tiros libres anotados");

        jTextField_TLibres.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jTextField_TLibresActionPerformed(evt);
            }
        });

        jLabel3.setText("Tiros de 2 anotados");

        jLabel4.setText("Tiros triples anotados");

        jLabel7.setText("Personales recibidas");

        jLabel5.setText("Tapones recibidos");

        jLabel_asistencias.setText("Tiros libres fallados");

        jTextField_TLibresF.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jTextField_TLibresFActionPerformed(evt);
            }
        });

        jLabel_fallosACanasta.setText("Tiros de 2 fallados ");

        jLabel_BalPerdidos.setText("Tiros triples fallados");

        jLabel_BalRecuperados.setText("Personales cometidas");

        jLabel_taponesHechos.setText("Tapones cometidos");

        Boton_guardar.setText("Guardar");
        Boton_guardar.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                Boton_guardarActionPerformed(evt);
            }
        });

        Boton_modActa.setText("Modificar");
        Boton_modActa.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                Boton_modActaActionPerformed(evt);
            }
        });

        jLabel9.setText("Rebotes");

        jLabel10.setText("Perdidas");

        jLabel11.setText("Asistencias");

        jTextField_Asistencias.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jTextField_AsistenciasActionPerformed(evt);
            }
        });

        jLabel12.setText("Robos");

        jLabel13.setText("Valoracion: ");

        jTable_jugadoresLocal.setModel(new javax.swing.table.DefaultTableModel(
            new Object [][] {

            },
            new String [] {
                "Nombre", "Apellidos", "Dorsal"
            }
        ));
        jTable_jugadoresLocal.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                jTable_jugadoresLocalMouseClicked(evt);
            }
        });
        jScrollPane2.setViewportView(jTable_jugadoresLocal);

        jLabel1.setText("LOCAL:");

        jTable_jugadoresVisit.setModel(new javax.swing.table.DefaultTableModel(
            new Object [][] {

            },
            new String [] {
                "Nombre", "Apellidos", "Dorsal"
            }
        ));
        jTable_jugadoresVisit.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                jTable_jugadoresVisitMouseClicked(evt);
            }
        });
        jScrollPane3.setViewportView(jTable_jugadoresVisit);

        jLabel6.setText("VISIT:");

        javax.swing.GroupLayout jPanelActaLayout = new javax.swing.GroupLayout(jPanelActa);
        jPanelActa.setLayout(jPanelActaLayout);
        jPanelActaLayout.setHorizontalGroup(
            jPanelActaLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanelActaLayout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanelActaLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                    .addGroup(jPanelActaLayout.createSequentialGroup()
                        .addComponent(Boton_modActa, javax.swing.GroupLayout.PREFERRED_SIZE, 88, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addGap(18, 18, 18)
                        .addComponent(Boton_guardar, javax.swing.GroupLayout.PREFERRED_SIZE, 88, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addGroup(jPanelActaLayout.createSequentialGroup()
                        .addGroup(jPanelActaLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanelActaLayout.createSequentialGroup()
                                .addComponent(jLabel13)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                .addComponent(jTextField_valoracion, javax.swing.GroupLayout.PREFERRED_SIZE, 78, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addGap(108, 108, 108))
                            .addGroup(jPanelActaLayout.createSequentialGroup()
                                .addGroup(jPanelActaLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                    .addComponent(jLabel1)
                                    .addGroup(jPanelActaLayout.createSequentialGroup()
                                        .addComponent(jScrollPane2, javax.swing.GroupLayout.PREFERRED_SIZE, 233, javax.swing.GroupLayout.PREFERRED_SIZE)
                                        .addGap(18, 18, 18)
                                        .addGroup(jPanelActaLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                                            .addGroup(jPanelActaLayout.createSequentialGroup()
                                                .addGroup(jPanelActaLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                                    .addComponent(jLabel2)
                                                    .addComponent(jLabel11, javax.swing.GroupLayout.PREFERRED_SIZE, 65, javax.swing.GroupLayout.PREFERRED_SIZE)
                                                    .addComponent(jLabel5)
                                                    .addComponent(jLabel9))
                                                .addGroup(jPanelActaLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                                                    .addGroup(jPanelActaLayout.createSequentialGroup()
                                                        .addGap(18, 18, 18)
                                                        .addComponent(jTextField_TLibres, javax.swing.GroupLayout.DEFAULT_SIZE, 30, Short.MAX_VALUE))
                                                    .addGroup(javax.swing.GroupLayout.Alignment.LEADING, jPanelActaLayout.createSequentialGroup()
                                                        .addGap(18, 18, 18)
                                                        .addGroup(jPanelActaLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                                            .addComponent(jTextField_Rebotes, javax.swing.GroupLayout.Alignment.TRAILING)
                                                            .addComponent(jTextField_TaponesR)
                                                            .addComponent(jTextField_Asistencias)))))
                                            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanelActaLayout.createSequentialGroup()
                                                .addGroup(jPanelActaLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                                    .addComponent(jLabel3)
                                                    .addComponent(jLabel4)
                                                    .addComponent(jLabel7))
                                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                                                .addGroup(jPanelActaLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                                                    .addComponent(jTextField_PersonalR, javax.swing.GroupLayout.DEFAULT_SIZE, 30, Short.MAX_VALUE)
                                                    .addComponent(jTextField_Ttres)
                                                    .addComponent(jTextField_Tdos))))
                                        .addGroup(jPanelActaLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                            .addGroup(jPanelActaLayout.createSequentialGroup()
                                                .addGap(35, 35, 35)
                                                .addGroup(jPanelActaLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                                    .addComponent(jLabel10)
                                                    .addComponent(jLabel_taponesHechos)
                                                    .addComponent(jLabel_BalRecuperados)
                                                    .addComponent(jLabel12)
                                                    .addComponent(jLabel_BalPerdidos)
                                                    .addComponent(jLabel_asistencias)))
                                            .addGroup(jPanelActaLayout.createSequentialGroup()
                                                .addGap(33, 33, 33)
                                                .addComponent(jLabel_fallosACanasta)))
                                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 16, Short.MAX_VALUE)
                                        .addGroup(jPanelActaLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                            .addComponent(jTextField_Robos, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.PREFERRED_SIZE, 30, javax.swing.GroupLayout.PREFERRED_SIZE)
                                            .addComponent(jTextField_Perdidas, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.PREFERRED_SIZE, 30, javax.swing.GroupLayout.PREFERRED_SIZE)
                                            .addComponent(jTextField_TaponesC, javax.swing.GroupLayout.Alignment.TRAILING)
                                            .addComponent(jTextField_PersonalC, javax.swing.GroupLayout.Alignment.TRAILING)
                                            .addComponent(jTextField_TtresF, javax.swing.GroupLayout.Alignment.TRAILING)
                                            .addComponent(jTextField_TdosF, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.PREFERRED_SIZE, 30, javax.swing.GroupLayout.PREFERRED_SIZE)
                                            .addComponent(jTextField_TLibresF, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.PREFERRED_SIZE, 30, javax.swing.GroupLayout.PREFERRED_SIZE))))
                                .addGap(18, 18, 18)))
                        .addGroup(jPanelActaLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(jLabel6)
                            .addComponent(jScrollPane3, javax.swing.GroupLayout.PREFERRED_SIZE, 136, javax.swing.GroupLayout.PREFERRED_SIZE))))
                .addContainerGap())
        );

        jPanelActaLayout.linkSize(javax.swing.SwingConstants.HORIZONTAL, new java.awt.Component[] {Boton_guardar, Boton_modActa});

        jPanelActaLayout.linkSize(javax.swing.SwingConstants.HORIZONTAL, new java.awt.Component[] {jScrollPane2, jScrollPane3});

        jPanelActaLayout.linkSize(javax.swing.SwingConstants.HORIZONTAL, new java.awt.Component[] {jTextField_Asistencias, jTextField_Perdidas, jTextField_PersonalC, jTextField_PersonalR, jTextField_Rebotes, jTextField_Robos, jTextField_TLibres, jTextField_TLibresF, jTextField_TaponesC, jTextField_TaponesR, jTextField_Tdos, jTextField_TdosF, jTextField_Ttres, jTextField_TtresF});

        jPanelActaLayout.setVerticalGroup(
            jPanelActaLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanelActaLayout.createSequentialGroup()
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addGroup(jPanelActaLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel1)
                    .addComponent(jLabel6))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanelActaLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jScrollPane2, javax.swing.GroupLayout.PREFERRED_SIZE, 195, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jScrollPane3, javax.swing.GroupLayout.PREFERRED_SIZE, 80, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addGroup(jPanelActaLayout.createSequentialGroup()
                        .addGroup(jPanelActaLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addGroup(jPanelActaLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                                .addComponent(jTextField_TLibresF, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addComponent(jLabel_asistencias))
                            .addGroup(jPanelActaLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                                .addComponent(jTextField_TLibres, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addComponent(jLabel2)))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addGroup(jPanelActaLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addGroup(jPanelActaLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                                .addComponent(jTextField_TdosF, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addComponent(jLabel_fallosACanasta))
                            .addGroup(jPanelActaLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                                .addComponent(jTextField_Tdos, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addComponent(jLabel3)))
                        .addGap(3, 3, 3)
                        .addGroup(jPanelActaLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(jTextField_TtresF, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(jLabel_BalPerdidos)
                            .addComponent(jTextField_Ttres, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(jLabel4))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addGroup(jPanelActaLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(jTextField_PersonalC, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addGroup(jPanelActaLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                                .addComponent(jLabel_BalRecuperados)
                                .addComponent(jTextField_PersonalR, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addComponent(jLabel7)))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addGroup(jPanelActaLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(jTextField_TaponesC, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addGroup(jPanelActaLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                                .addComponent(jLabel_taponesHechos)
                                .addComponent(jTextField_Asistencias, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addComponent(jLabel11)))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addGroup(jPanelActaLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(jTextField_Perdidas, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(jLabel10, javax.swing.GroupLayout.PREFERRED_SIZE, 12, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(jTextField_TaponesR, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(jLabel5))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addGroup(jPanelActaLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(jLabel12)
                            .addComponent(jTextField_Robos, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(jTextField_Rebotes, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(jLabel9))))
                .addGap(16, 16, 16)
                .addGroup(jPanelActaLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel13)
                    .addComponent(jTextField_valoracion, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanelActaLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(Boton_modActa, javax.swing.GroupLayout.PREFERRED_SIZE, 50, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(Boton_guardar, javax.swing.GroupLayout.PREFERRED_SIZE, 50, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(185, 185, 185))
        );

        jPanelActaLayout.linkSize(javax.swing.SwingConstants.VERTICAL, new java.awt.Component[] {Boton_guardar, Boton_modActa});

        jPanelActaLayout.linkSize(javax.swing.SwingConstants.VERTICAL, new java.awt.Component[] {jTextField_Asistencias, jTextField_Perdidas, jTextField_PersonalC, jTextField_PersonalR, jTextField_Rebotes, jTextField_Robos, jTextField_TLibres, jTextField_TLibresF, jTextField_TaponesC, jTextField_TaponesR, jTextField_Tdos, jTextField_TdosF, jTextField_Ttres, jTextField_TtresF});

        jPanelActaLayout.linkSize(javax.swing.SwingConstants.VERTICAL, new java.awt.Component[] {jScrollPane2, jScrollPane3});

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);
        this.setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addComponent(jPanelPartido1, javax.swing.GroupLayout.PREFERRED_SIZE, 723, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jPanelActa, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jPanelActa, javax.swing.GroupLayout.PREFERRED_SIZE, 361, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jPanelPartido1, javax.swing.GroupLayout.PREFERRED_SIZE, 364, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );
    }// </editor-fold>//GEN-END:initComponents

    private void jTextField_VisitanteActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jTextField_VisitanteActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_jTextField_VisitanteActionPerformed

    private void jTextField_LocalActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jTextField_LocalActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_jTextField_LocalActionPerformed

    private void jButton_ConsultarActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton_ConsultarActionPerformed
         
        if(ControladorCompeticion.getInstancia().consultarPartido(this.cargarDatosFormulario())){
            this.jButton_Modificar.setEnabled(true);
            this.jButton_Eliminar.setEnabled(true);
            this.Boton_addActa.setEnabled(true);
            this.Boton_ConsultarEquipo.setEnabled(true);
            this.jButton_consultarActa.setEnabled(false);
            this.jButton_consultarActa.setEnabled(true);
        }else{
            this.mostrarMensaje("PARTIDO NO ENCONTRADO", "ERROR", 0);
        }

    }//GEN-LAST:event_jButton_ConsultarActionPerformed

    private void jButton_CrearActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton_CrearActionPerformed
      
        if(! ControladorCompeticion.getInstancia().consultarPartido(this.cargarDatosFormulario())) {
            if(ControladorCompeticion.getInstancia().addPartido(this.cargarDatosFormulario())) {
            limpiarInterfaz();
            }
        }else{
            mostrarMensaje("EXISTE UN PARTIDO CON LOS MISMOS DATOS", "AVISO", 0);   
       }
    }//GEN-LAST:event_jButton_CrearActionPerformed

    private void Boton_ConsultarEquipoActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_Boton_ConsultarEquipoActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_Boton_ConsultarEquipoActionPerformed

    private void jButton_ModificarActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton_ModificarActionPerformed
        ControladorCompeticion.getInstancia().modificarPartido(this.cargarDatosFormulario());
    }//GEN-LAST:event_jButton_ModificarActionPerformed

    private void jButton_EliminarActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton_EliminarActionPerformed
        if(ControladorCompeticion.getInstancia().eliminarPartido()) {
            limpiarInterfaz();
            limpiarTablaPartidos();
        }
    }//GEN-LAST:event_jButton_EliminarActionPerformed

    private void Boton_addActaActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_Boton_addActaActionPerformed
        jPanelPartido1.setVisible(false);
        Boton_guardar.setVisible(true);
        Boton_modActa.setVisible(false);
        jPanelActa.setVisible(true);
    
    }//GEN-LAST:event_Boton_addActaActionPerformed

    private void Boton_LimpiarActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_Boton_LimpiarActionPerformed
        limpiarInterfaz();
        limpiarTablaPartidos();
    }//GEN-LAST:event_Boton_LimpiarActionPerformed

    private void jButton_consultarActaActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton_consultarActaActionPerformed
        jPanelPartido1.setVisible(false);
        Boton_modActa.setVisible(true);
        Boton_guardar.setVisible(false);
        jPanelActa.setVisible(true);
        
      ControladorCompeticion.getInstancia().consultarActa(Table_Partidos.getSelectedRow());
    }//GEN-LAST:event_jButton_consultarActaActionPerformed

    private void Table_PartidosMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_Table_PartidosMouseClicked
                    
        int row_index = Table_Partidos.getSelectedRow();
        if(Table_Partidos.isEnabled()){
            SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd");
            Date fecha=null;
            try {
                fecha = formatter.parse(Table_Partidos.getValueAt(row_index, 3).toString());
            } catch (ParseException ex) {
                //Logger.getLogger(InterfazPartido.class.getName()).log(Level.SEVERE, null, ex);
            }
            mostrarPartido(Table_Partidos.getValueAt(row_index, 0).toString(),
                            Table_Partidos.getValueAt(row_index, 1).toString(),
                            Table_Partidos.getValueAt(row_index, 2).toString(),
                            fecha);
            ControladorCompeticion.getInstancia().actualizarPartidoActivo(row_index);
        }
        
    }//GEN-LAST:event_Table_PartidosMouseClicked

    private void Boton_guardarActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_Boton_guardarActionPerformed
        ControladorCompeticion.getInstancia().addActa(this.cargarDatosFormularioActa());
    }//GEN-LAST:event_Boton_guardarActionPerformed

    private void Boton_modActaActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_Boton_modActaActionPerformed
        ControladorCompeticion.getInstancia().modificarActa(this.cargarDatosFormularioActa());
    }//GEN-LAST:event_Boton_modActaActionPerformed

    private void jTextField_AsistenciasActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jTextField_AsistenciasActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_jTextField_AsistenciasActionPerformed

    private void jTextField_TLibresFActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jTextField_TLibresFActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_jTextField_TLibresFActionPerformed

    private void jTextField_TLibresActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jTextField_TLibresActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_jTextField_TLibresActionPerformed

    private void jTable_jugadoresLocalMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jTable_jugadoresLocalMouseClicked
        // TODO add your handling code here:
        int row_index = jTable_jugadoresLocal.getSelectedRow();
        if(jTable_jugadoresLocal.isEnabled()){

            //mostrarEstadisitcas(...);
            
        }
    }//GEN-LAST:event_jTable_jugadoresLocalMouseClicked

    private void jTable_jugadoresVisitMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jTable_jugadoresVisitMouseClicked
        // TODO add your handling code here:
                int row_index = jTable_jugadoresVisit.getSelectedRow();
        if(jTable_jugadoresVisit.isEnabled()){

            //mostrarEstadisitcas(...);
            
        }
    }//GEN-LAST:event_jTable_jugadoresVisitMouseClicked

    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JButton Boton_ConsultarEquipo;
    private javax.swing.JButton Boton_Limpiar;
    private javax.swing.JButton Boton_addActa;
    private javax.swing.JButton Boton_guardar;
    private javax.swing.JButton Boton_modActa;
    private com.toedter.calendar.JDateChooser JCalendarFechaParitdo;
    private javax.swing.JTable Table_Partidos;
    private javax.swing.JButton jButton_Consultar;
    private javax.swing.JButton jButton_Crear;
    private javax.swing.JButton jButton_Eliminar;
    private javax.swing.JButton jButton_Modificar;
    private javax.swing.JButton jButton_consultarActa;
    private javax.swing.JLabel jLabel1;
    private javax.swing.JLabel jLabel10;
    private javax.swing.JLabel jLabel11;
    private javax.swing.JLabel jLabel12;
    private javax.swing.JLabel jLabel13;
    private javax.swing.JLabel jLabel2;
    private javax.swing.JLabel jLabel3;
    private javax.swing.JLabel jLabel4;
    private javax.swing.JLabel jLabel5;
    private javax.swing.JLabel jLabel6;
    private javax.swing.JLabel jLabel7;
    private javax.swing.JLabel jLabel9;
    private javax.swing.JLabel jLabel_BalPerdidos;
    private javax.swing.JLabel jLabel_BalRecuperados;
    private javax.swing.JLabel jLabel_Fecha;
    private javax.swing.JLabel jLabel_Local;
    private javax.swing.JLabel jLabel_Partido;
    private javax.swing.JLabel jLabel_Resultado;
    private javax.swing.JLabel jLabel_Visitante;
    private javax.swing.JLabel jLabel_asistencias;
    private javax.swing.JLabel jLabel_fallosACanasta;
    private javax.swing.JLabel jLabel_sep;
    private javax.swing.JLabel jLabel_taponesHechos;
    private javax.swing.JPanel jPanelActa;
    private javax.swing.JPanel jPanelPartido1;
    private javax.swing.JScrollPane jScrollPane1;
    private javax.swing.JScrollPane jScrollPane2;
    private javax.swing.JScrollPane jScrollPane3;
    private javax.swing.JTable jTable_jugadoresLocal;
    private javax.swing.JTable jTable_jugadoresVisit;
    private javax.swing.JTextField jTextField_Asistencias;
    private javax.swing.JTextField jTextField_Local;
    private javax.swing.JTextField jTextField_Perdidas;
    private javax.swing.JTextField jTextField_PersonalC;
    private javax.swing.JTextField jTextField_PersonalR;
    private javax.swing.JTextField jTextField_Rebotes;
    private javax.swing.JTextField jTextField_Resul;
    private javax.swing.JTextField jTextField_Robos;
    private javax.swing.JTextField jTextField_TLibres;
    private javax.swing.JTextField jTextField_TLibresF;
    private javax.swing.JTextField jTextField_TaponesC;
    private javax.swing.JTextField jTextField_TaponesR;
    private javax.swing.JTextField jTextField_Tdos;
    private javax.swing.JTextField jTextField_TdosF;
    private javax.swing.JTextField jTextField_Ttres;
    private javax.swing.JTextField jTextField_TtresF;
    private javax.swing.JTextField jTextField_Visitante;
    private javax.swing.JTextField jTextField_valoracion;
    // End of variables declaration//GEN-END:variables

    void inicializar_Crear() {
        
        this.es_gestor = true;
        jPanelPartido1.setVisible(true);
        jPanelActa.setVisible(false);
        this.Boton_ConsultarEquipo.setEnabled(true);
        this.jButton_Crear.setEnabled(true);
        this.jButton_Consultar.setEnabled(false);
        this.jButton_Modificar.setEnabled(false);
        this.jButton_Eliminar.setEnabled(false);
        this.Boton_ConsultarEquipo.setEnabled(false);
        this.Boton_addActa.setEnabled(false);
        this.jButton_consultarActa.setEnabled(false);
        limpiarInterfaz();
        limpiarTablaPartidos();

    }

    void inicializar_Consultar(boolean esgestor) {
        
        this.es_gestor = esgestor;
        jPanelPartido1.setVisible(true);
        jPanelActa.setVisible(false);
        this.Boton_ConsultarEquipo.setEnabled(false);
        this.Boton_addActa.setEnabled(false);
        this.jButton_Crear.setEnabled(false);
        this.jButton_Consultar.setEnabled(true);
        this.jButton_Modificar.setEnabled(false);
        this.jButton_Eliminar.setEnabled(false);
        this.jButton_consultarActa.setEnabled(false);
        limpiarInterfaz();
        limpiarTablaPartidos();
    }
    public void mostrarMensaje(String mensaje, String titulo, int i) {
        JOptionPane.showMessageDialog(null, mensaje, titulo, i);
    }

    public void mostrarPartido(String NomLocal, String NomVisitante, String resultado, Date fecha) {
        jTextField_Local.setText(NomLocal);
        jTextField_Visitante.setText(NomVisitante);
        jTextField_Resul.setText(resultado);
        //SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
        this.JCalendarFechaParitdo.setDate(fecha);
    }
    
    public void limpiarInterfaz(){
        jTextField_Local.setText("");
        jTextField_Visitante.setText("");
        jTextField_Resul.setText("");
        this.JCalendarFechaParitdo.setDate(null);
    }
    
       public void add_Partido_Tabla(int fila, String NombreLoc, String NombreVisit, String Result, String Fecha){
       
       DefaultTableModel temp = (DefaultTableModel) Table_Partidos.getModel();
       if(fila==Table_Partidos.getRowCount()){
            Object nuevo[] = {fila+1, "", "", "", ""};
            temp.addRow(nuevo);
        }
        this.Table_Partidos.setValueAt(NombreLoc, fila, 0);
        this.Table_Partidos.setValueAt(NombreVisit, fila, 1);
        this.Table_Partidos.setValueAt(Result, fila, 2);
        this.Table_Partidos.setValueAt(Fecha, fila, 3);
    }
       
    public void limpiarTablaPartidos(){
 
        DefaultTableModel temp = (DefaultTableModel) Table_Partidos.getModel();
        for (int i = temp.getRowCount() - 1; i >= 0; i--) {
            temp.removeRow(i);
        }
        Table_Partidos.clearSelection();
    }

    public void add_JugadoresLocal_Tabla(int fila, String nomJugador, String apellidosJugador, Integer dorsalJugador) {

       DefaultTableModel temp = (DefaultTableModel) jTable_jugadoresLocal.getModel();
       if(fila==jTable_jugadoresLocal.getRowCount()){
            Object nuevo[] = {fila+1, "", "", ""};
            temp.addRow(nuevo);
        }
        this.jTable_jugadoresLocal.setValueAt(nomJugador, fila, 0);
        this.jTable_jugadoresLocal.setValueAt(apellidosJugador, fila, 1);
        this.jTable_jugadoresLocal.setValueAt(dorsalJugador, fila, 2);
    }

     public void limpiarTablaJugadoresLocal(){
 
        DefaultTableModel temp = (DefaultTableModel) jTable_jugadoresLocal.getModel();
        for (int i = temp.getRowCount() - 1; i >= 0; i--) {
            temp.removeRow(i);
        }
        jTable_jugadoresLocal.clearSelection();
    }
    public void add_JugadoresVisit_Tabla(int fila, String nomJugador, String apellidosJugador, Integer dorsalJugador) {
        
       DefaultTableModel temp = (DefaultTableModel) jTable_jugadoresVisit.getModel();
       if(fila==jTable_jugadoresVisit.getRowCount()){
            Object nuevo[] = {fila+1, "", "", ""};
            temp.addRow(nuevo);
        }
        this.jTable_jugadoresVisit.setValueAt(nomJugador, fila, 0);
        this.jTable_jugadoresVisit.setValueAt(apellidosJugador, fila, 1);
        this.jTable_jugadoresVisit.setValueAt(dorsalJugador, fila, 2);
    }
     public void limpiarTablaJugadoresVisit(){
 
        DefaultTableModel temp = (DefaultTableModel) jTable_jugadoresVisit.getModel();
        for (int i = temp.getRowCount() - 1; i >= 0; i--) {
            temp.removeRow(i);
        }
        jTable_jugadoresVisit.clearSelection();
    }

    public void mostrarEstadisticas(String TLibres, String TLibresF, String Tdos,
                String TdosF, String Ttres, String TtresF, String PersonalR,
                String PersonalC, String TaponesR, String TaponesC, String Rebotes,
                String Perdidas, String Robos, String Asistencias, String valoracion) {
        
        this.jTextField_TLibres.setText(TLibres);
        this.jTextField_TLibresF.setText(TLibresF);            
        this.jTextField_Tdos.setText(Tdos);
        this.jTextField_TdosF.setText(TdosF);
        this.jTextField_Ttres.setText(Ttres);
        this.jTextField_TtresF.setText(TtresF);       
        this.jTextField_PersonalR.setText(PersonalR);
        this.jTextField_PersonalC.setText(PersonalC);       
        this.jTextField_TaponesR.setText(TaponesR);
        this.jTextField_TaponesC.setText(TaponesC);
        this.jTextField_Rebotes.setText(Rebotes);
        this.jTextField_Perdidas.setText(Perdidas);
        this.jTextField_Robos.setText(Robos);
        this.jTextField_Asistencias.setText(Asistencias);
        this.jTextField_valoracion.setText(valoracion);
        
    }


}
